﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="CRMWeb.Pages.Login" Debug="true" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>>Morgan CRM</title>
    <link rel="Shortcut Icon" href="/Media/favicon2.png" />
    <link rel="stylesheet" type="text/css" href="/Css/CrmStyle.css" />
</head>
<body>
    <form id="form1" runat="server">
        <div id="wrapper" style="text-align: center; padding: 5px; margin-top: 50px;">
            <div>
                <div style="margin: 5px 200px; padding: 50px 5px 100px 0px; border: 2px solid #898989; border-radius: 10px; box-shadow: 2px 2px 5px #888888;">
                    <asp:Image ID="Image1" runat="server" ImageUrl="/Media/MF_Slogan.jpg" />
                    <br />
                    <div id="div_login" style="margin: 50px 0 20px 50px;">
                        <asp:Label ID="Label1" runat="server" Text="UserName *: " Width="120px" Style="font: bold 18px Arial;"></asp:Label>
                        <asp:TextBox ID="txtUser" runat="server" Width="200px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="UserName not empty" ControlToValidate="txtUser"
                            Display="Static" ForeColor="#FF3300"></asp:RequiredFieldValidator>
                        <br />
                        <br />
                        <asp:Label ID="Label2" runat="server" Text="Password *:" Width="120px" Style="font: bold 18px Arial;"></asp:Label>
                        <asp:TextBox ID="txtPassword" runat="server" Width="200px" TextMode="Password"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Password not empty" ControlToValidate="txtPassword"
                            Display="Static" ForeColor="#FF3300"></asp:RequiredFieldValidator>
                        <br />
                        <br />
                        <asp:Label ID="lblLoginInfo" runat="server" Text="" ForeColor="#FF3300" Font-Bold="true"></asp:Label>
                        <br />
                        <br />
                        <asp:Button ID="btnLogin" runat="server" OnClientClick="ClrCookie()" Text="Login" OnClick="btnLogin_Click" Height="30px" Width="100px" Font-Bold="True" />
                        <br />

                    </div>
                </div>
            </div>
        </div>
    </form>
    <script type="text/javascript">

        //set cookies value for Theme
        function setThemeCookie(key, value) {
            var expires = new Date();
            expires.setTime(expires.getTime() + (1440 * 60 * 1000)); //20 mins
            document.cookie = key + '=' + value + ';expires=' + expires.toUTCString() + ';path=/';

        }
        //set cookies value
        function setDdCookie(key, value) {
            var expires = new Date();
            expires.setTime(expires.getTime() + (1440 * 60 * 1000)); //20 mins
            document.cookie = key + '=' + value + ';expires=' + expires.toUTCString() + ';path=/';
        }
        //Empty Cookies:
        function ClrCookie() {
            setDdCookie('Com', '');
            setThemeCookie('Theme', '');
        }


        function getCookie(key) {
            var keyValue = document.cookie.match('(^|;) ?' + key + '=([^;]*)(;|$)');
            return keyValue ? keyValue[2] : '';
        }

    </script>
</body>
</html>
